From: GeoffreyT2000 Date: Thu, 9 May 2019 00:56:15 +0000 (-0700) Subject: Remove title protection correctly for undeletions and imports X-Git-Tag: 1.34.0-rc.0~692^2 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin//%22%24path/%7B%24disabledImages%5B%24type%5D%7D/%22?a=commitdiff_plain;h=00104e2c0eeb7e713d0945d5b33893dac6e0d250;p=lhc%2Fweb%2Fwiklou.git Remove title protection correctly for undeletions and imports Undeletions and imports can both produce "new" pages with more than 1 revision. The fact that $options['created'] for the associated DerivedPageDataUpdater instance is unexpectedly changed to false is due to the fact that the latest revision often has a nonzero rev_parent_id. This causes WikiPage::onArticleCreate not to be applied correctly, and so title protection is not correctly removed. The part about "created" being forced is therefore being fixed. Bug: T200088 Change-Id: I8c899893486976285eb6fac87d641e93a616676d --- diff --git a/includes/Storage/DerivedPageDataUpdater.php b/includes/Storage/DerivedPageDataUpdater.php index 68814ef3aa..f49ea60a28 100644 --- a/includes/Storage/DerivedPageDataUpdater.php +++ b/includes/Storage/DerivedPageDataUpdater.php @@ -1208,7 +1208,8 @@ class DerivedPageDataUpdater implements IDBAccessObject, LoggerAwareInterface { } // "created" is forced here - $this->options['created'] = ( $this->pageState['oldId'] === 0 ); + $this->options['created'] = ( $this->options['created'] || + ( $this->pageState['oldId'] === 0 ) ); $this->revision = $revision;